<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <meta name="csrf-param" content="_token">

    <title>{{config('app.name')}}</title>
 
    <link rel="icon" type="image/jpg" href="/favicon.jpg" />

    <!-- Styles -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.9.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.9.0/css/v4-shims.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@2.4.12/bower_components/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@2.4.12/bower_components/Ionicons/css/ionicons.min.css">
{{--    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@2.4.12/bower_components/font-awesome/css/font-awesome.min.css">--}}
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@2.4.12/dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@2.4.12/dist/css/skins/skin-blue-light.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@2.4.12/bower_components/select2/dist/css/select2.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@2.4.12/plugins/iCheck/square/blue.css">
    <!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/eonasdan-bootstrap-datetimepicker-npm@4.17.42/build/css/bootstrap-datetimepicker.min.css"> -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/blueimp-file-upload@10.2.0/css/jquery.fileupload.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-datepicker@1.9.0/dist/css/bootstrap-datepicker.min.css">
    <link rel="stylesheet" type="text/css" href="https://oss-frakiss.oss-cn-chengdu.aliyuncs.com/js/datetimepicker-master/build/jquery.datetimepicker.min.css"/ >

    <style>
        .main-header .sidebar-toggle {
            font-family: "Font Awesome 5 Free";
            font-weight: 900;
            -webkit-font-smoothing: antialiased;
            display: inline-block;
            font-style: normal;
            font-variant: normal;
            text-rendering: auto;
        }
        #alert-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            z-index: 9999;
        }
        #alert-container > div {
            margin-top: 20px;
            margin-left: auto;
            margin-right: auto;
            width: 500px;
            top: 100px;
        }
        #alert-container .alert.no-content h4 {
            margin-bottom: 0;
        }
        .d-tabs {
            box-sizing: border-box;
            background: #fff;
            padding: 10px 40px 0;
            font-size: 15px;
        }
        .d-tabs li {
            float: left;
        }
        .d-tabs li a,
        .d-tabs>li>a:hover,
        .d-tabs>li>a:active,
        .d-tabs>li>a:focus {
            color: #173890;
        }
        .d-tabs li.active {
            border-bottom: 5px solid #3967E5;
        }
        .d-tabs li.active a,
        .d-tabs li:hover,
        .d-tabs li:hover a{
            background: transparent;
        }
        .clearfix:after {
            display: block;
            content: '';
            clear: both;
            height: 0;
            visibility: hidden;
        }
        .custom-invoice {
            position: relative;
            background: #fff;
            border: 1px solid #f4f4f4;
            padding: 20px;
            margin-bottom: 10px;
        }
        .select2-container .select2-selection--single {
            height: 34px;
        }
        .skin-blue-light .sidebar-menu>li>a {
            border-left: 3px solid transparent;
            font-weight: 600;
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
        }
        .sidebar-menu>li>a {
            padding: 12px 25px 12px 15px;
            display: block;
        }

        /*下拉菜单 样式调整*/
        .select2-hidden-accessible{
            border: 0 !important;
            clip: rect(0 0 0 0) !important;
            height: 1px !important;
            margin: -1px !important;
            overflow: hidden !important;
            padding: 0 !important;
            position: relative !important;
            width: 1px !important;
        }
    </style>

    @stack('stylesheets')
</head>
<body class="skin-blue-light">
<!-- <body class="skin-blue-light layout-boxed sidebar-mini"> -->
<div class="wrapper" style="min-width: 1550px;">
<!-- <div class="wrapper"> -->
    <header class="main-header">
        @include('layouts.header')
    </header>

    <aside class="main-sidebar">
        @include('layouts.sidebar')
    </aside>

    <div class="content-wrapper">
        <section class="content-header">
            <h1>
                @yield('content-header')
            </h1>
            {{--<ol class="breadcrumb">--}}
                {{--@yield('breadcrumb')--}}
            {{--</ol>--}}
        </section>
        <section class="content">
            @yield('content')
        </section>

        <!-- 删除确认 -->
        <div class="modal fade" id="delete-confirm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-dialog" style=" width: 300px; position: absolute; left: 45%; top: 40%;">
                    <div class="modal-content">
                        <div class="modal-body">
                            <p>删除后不能恢复，确认要删除吗?</p>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                            <a class="btn btn-success" id="delete-confirm-success" data-method="delete" href="">保存</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <footer class="main-footer">
        @include('layouts.footer')
    </footer>
</div>

<div id="alert-container">
    @if(session('success'))
        <div class="alert alert-success alert-dismissible no-content">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
            <h4><i class="icon fa fa-check"></i>{{ session('success') }}</h4>
        </div>
    @endif
    @if(session('warning'))
        <div class="alert alert-warning alert-dismissible no-content">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
            <h4><i class="icon fa fa-check"></i>{{ session('warning') }}</h4>
        </div>
    @endif
    @if(session('error'))
        <div class="alert alert-danger alert-dismissible no-content">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
            <h4><i class="icon fa fa-ban"></i>{{ session('error') }}</h4>
        </div>
    @endif
    @if(session('errors'))
        <div class="alert alert-danger alert-dismissible">
            <!-- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> -->
            <h4><i class="icon fa fa-ban"></i>错误</h4>
            @foreach(session('errors')->all() as $message)
                <p>{{ $message }}</p>
            @endforeach

            <br>
            <br>
            <button type="button" style="width:35%;margin: 0px auto;" class="btn btn-block btn-default btn-sm" data-dismiss="alert" aria-hidden="true">关闭</button>
        </div>
    @endif
    @auth
        @include('layouts.notifier')
    @endauth
</div>

<!-- Scripts -->
<script src="https://cdn.jsdelivr.net/npm/admin-lte@2.4.12/bower_components/jquery/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/moment@2.24.0/moment.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery-ujs@1.2.2/src/rails.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/admin-lte@2.4.12/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/admin-lte@2.4.12/dist/js/adminlte.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/admin-lte@2.4.12/bower_components/select2/dist/js/select2.full.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/admin-lte@2.4.12/bower_components/select2/dist/js/i18n/zh-CN.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/admin-lte@2.4.12/plugins/iCheck/icheck.min.js"></script>
<script src="https://oss-frakiss.oss-cn-chengdu.aliyuncs.com/js/datetimepicker-master/build/jquery.datetimepicker.full.min.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/eonasdan-bootstrap-datetimepicker-npm@4.17.42/build/js/bootstrap-datetimepicker.min.js"></script> -->
<script src="https://cdn.jsdelivr.net/npm/blueimp-file-upload@10.2.0/js/vendor/jquery.ui.widget.js"></script>
<script src="https://cdn.jsdelivr.net/npm/blueimp-file-upload@10.2.0/js/jquery.fileupload.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap-datepicker@1.9.0/js/bootstrap-datepicker.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery-form@4.2.2/dist/jquery.form.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tinymce@4.9.4/tinymce.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tinymce@4.9.4/jquery.tinymce.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tinymce@4.9.4/themes/modern/theme.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tinymce@4.9.4/plugins/textcolor/plugin.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tinymce@4.9.4/plugins/image/plugin.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tinymce@4.9.4/plugins/autoresize/plugin.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tinymce@4.9.4/plugins/colorpicker/plugin.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tinymce@4.9.4/plugins/hr/plugin.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tinymce@4.9.4/plugins/preview/plugin.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tinymce@4.9.4/plugins/table/plugin.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tinymce@4.9.4/plugins/lists/plugin.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tinymce@4.9.4/plugins/media/plugin.min.js"></script>
{{--<script src="https://cdn.jsdelivr.net/npm/datatables.net@1.10.20/js/jquery.dataTables.min.js"></script>--}}
{{--<script src="https://cdn.jsdelivr.net/npm/datatables.net-bs@1.10.20/js/dataTables.bootstrap.min.js"></script>--}}

<script>
    $(".delete-confirm").on('click', function () {
        url = $(this).attr('data-href');
        $('#delete-confirm-success').attr('href', url);
        $('#delete-confirm').modal('show');
    });

    tinymce.PluginManager.add('uploadimage', function (editor) {

        function selectLocalImages() {
            var dom = editor.dom;
            var input_f = $('<input type="file" name="thumbnail[]" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="multiple">');
            input_f.on('change', function () {
                var form = $("<form/>",
                    {
                        action: editor.settings.images_upload_url, //设置上传图片的路由，配置在初始化时
                        style: 'display:none',
                        method: 'post',
                        enctype: 'multipart/form-data'
                    }
                );
                form.append(input_f);
                $(document.body).append(form);
                //ajax提交表单
                form.ajaxSubmit({
                    beforeSubmit: function () {
                        return true;
                    },
                    success: function (data) {
                        editor.focus();
                        if(data instanceof Array) {
                            data.forEach(function (img) {
                                editor.selection.setContent(dom.createHTML('img', {src: img.url}));
                            })
                        }else {
                            editor.selection.setContent(dom.createHTML('img', {src: data.location}));
                        }
                    }
                });
            });

            input_f.click();
        }

        editor.addCommand("mceUploadImageEditor", selectLocalImages);

        editor.addButton('uploadimage', {
            icon: 'image',
            tooltip: '上传图片',
            onclick: selectLocalImages
        });

        editor.addMenuItem('uploadimage', {
            icon: 'image',
            text: '上传图片',
            context: 'tools',
            onclick: selectLocalImages
        });
    });



    $('.treeview-menu').each(function(){
        $(this).find('.active').parents('.treeview').addClass('active')
        $(this).find('.active').parents('.treeview').find('#dropdownSubMenu1').find('i').attr('class', 'fa fa-bookmark')
    })
</script>

@stack('scripts')
</body>
</html>
